function guid() {
	return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
		var r = Math.random() * 16 | 0,
			v = c == 'x' ? r : (r & 0x3 | 0x8);
		return v.toString(16);
	});
}

export function storage(key, value) {
	return uni.setStorage({
		key: key,
		data: value
	})
}

export function getStorage(key) {
	return uni.getStorageSync(key)
}
/**
 * 未接入公众平台时，先使用缓存一个假的user sign
 */
export function userSign() {
	let key = 'user'
	let user = getStorage(key)
	if (user) {
		return user
	}
	user = guid()
	storage(key, user)
	return user
}